<template>
  <div class="recom">
    <div class="recom-in banxin2 tanxin">
      <div class="recom-in-l tanxin">
        <a href="#" class="tuijian">{{ list }}</a>
        <div class="recom-nav">
          <a href="#">华语</a>
          <span class="line">|</span>
          <a href="#">流行</a>
          <span class="line">|</span>
          <a href="#">摇滚</a>
          <span class="line">|</span>
          <a href="#">明摇</a>
          <span class="line">|</span>
          <a href="#">电子</a>
        </div>
        <span class="more"><a href="#">更多</a> <i>&nbsp;</i></span>
      </div>
      <!-- 右侧遍栏 -->
      <div class="songr">
        <div class="yh">
          <p class="y-d">
            登录网易云音乐，可以享受无限收藏的乐趣，并且无限同步到手机
          </p>
          <a href="#" class="gologin">用户登录</a>
        </div>
        <div
          class="singer tanxin"
          style="
            font-size: 12px;
            border-bottom: 1px solid #ccc;
            justify-content: space-around;
          "
        >
          <h3 style="font-weight: bold">入驻歌手</h3>
          <span>查看全部&gt;</span>
        </div>
        <ul style="margin-top: 20px; flex-direction: column" class="tanxin">
          <li
            style="align-items: center"
            v-for="items in singer"
            :key="items.id"
          >
            <a href="#" class="tanxin">
              <img width="62" height="62" :src="items.picUrl" alt="" />
              <p>{{ items.name }}</p>
            </a>
          </li>
        </ul>
        <div class="become">申请成为网易音乐人</div>

        <div
          class="zhubo"
          style="
            font-size: 12px;

            justify-content: start;
            margin-top: 20px;
          "
        >
          <h3
            style="
              font-weight: bold;
              width: 100%;
              border-bottom: 1px solid #ccc;
            "
          >
            热门主播
          </h3>
          <ul style="flex-direction: column" class="tanxin">
            <li
              style="align-items: center"
              v-for="item in singSong"
              :key="item.id"
            >
              <a href="#" class="tanxin" style="background-color: none">
                <img width="62" height="62" :src="item.picUrl" alt="" />
                <p>{{ item.name }}</p>
              </a>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { RanListApi, singerApi, singSongApi } from "@/request/api";
export default {
  props: ["list"],
  created() {
    RanListApi().then((res) => {
      console.log("侧栏", res.data.result);
      let { result } = res.data;
      this.result = result;
    });
    singerApi().then((res) => {
      // console.log(res);
      if (res.data.code === 200) {
        this.singer = res.data.list.artists.slice(0, 5);
        // console.log(this.singer);
      }
    });
    singSongApi().then((res) => {
      // console.log(res);
      if (res.data.code === 200) {
        this.singSong = res.data.artists.slice(5, 10);
        // console.log(this.singSong);
      }
    });
  },
  data() {
    return {
      result: [],
      singer: [],
      singSong: [],
    };
  },
};
</script>
 
<style lang = "less" scoped>
@import "../../assets//base.less";
* {
  margin: 0;
  padding: 0;
  list-style: none;
  text-decoration: none;
}
.recom-in {
  background: url("https://s2.music.126.net/style/web2/img/index/index.png?de3cf281afe9d404153f7fff35462f13")
    no-repeat;
  height: 33px;

  background-position: -225px -156px;
  line-height: 33px;
  .recom-in-l {
    padding: 0 10px 0 34px;
    border-bottom: 2px solid #c10d0c;
    width: 729px;
    align-items: center;
    box-sizing: border-box;
    .tuijian {
      font-size: 20px;
      font-weight: normal;
      line-height: 28px;
    }
    .recom-nav {
      transform: translateX(-130px);
      a {
        margin: 0 10px;
        font-size: 10px;
        color: #666;
      }
      span {
        color: #ccc;
      }
    }
    .more {
      transform: translateX(-30px);
      font-size: 10px;
      i {
        background: url("https://s2.music.126.net/style/web2/img/index/index.png?de3cf281afe9d404153f7fff35462f13")
          no-repeat;
        display: inline-block;
        width: 12px;
        height: 12px;
        margin-left: 4px;
        vertical-align: middle;
        background-position: 0 -240px;
      }
    }
  }
  .songr,
  zhubo {
    transform: translateY(-20px);
    width: 250px;
    height: 455px;
    .yh {
      width: 250px;
      height: 126px;
      background-color: rgba(190, 187, 187, 0.3);
      border: 1px solid #ccc;
      .gologin {
        color: #fff;
        width: 90px;
        margin: 10px auto;
        border-radius: 5px;
        background-color: darkgreen;
        height: 31px;
        display: block;
        height: 31px;
        font-size: 10px;
        text-align: center;
      }
      .y-d {
        font-size: 11px;
        margin-left: 20px;
      }
    }
    ul {
      li {
        margin: 10px auto;
        a {
          width: 210px;
          height: 62px;
          box-sizing: border-box;
          justify-content: start;
          background-color: rgba(190, 187, 187, 0.3);
          color: #c10d0c;
          font-size: 14px;
          font-weight: bold;
          border: 1px solid #ccc;
          p {
            margin-left: 20px;
            margin-top: 3px;
          }
        }
      }
    }
    .become {
      width: 210px;
      height: 31px;
      text-align: center;
      background-color: #fff;
      margin: 0 auto;
      border: 1px solid #ccc;
      border-radius: 3px;
      font-size: 12px;
      flex-wrap: bold;
    }
    .zhubo {
      ul {
        li {
          a {
          }
        }
      }
    }
  }
}
</style>